﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace XMLconfig
{
    public class XmlConfig
    {
        public void changeXMLconfig(string mail)
        {
            XmlElement email = null, root = null;
            XmlDocument xmldoc = new XmlDocument();
            xmldoc.Load("XMLFileConfig.xml");
            root = xmldoc.DocumentElement;
            email.GetElementsByTagName("email").Item(0).InnerText = mail;
        }
        public string getMailFromConfig()
        {
            XmlDocument doc = new XmlDocument();
            doc.Load("XMLFileConfig.xml");
            XmlElement root = doc.DocumentElement;
            XmlNodeList nodes = root.SelectNodes("/XMLFileConfig");

            foreach (XmlNode node in nodes)
            {
                string email = node["email"].InnerText;
                return email;
            }
            return null;
        }
    }
}
